#ifndef _PAN_DETECT_H_
#define _PAN_DETECT_H_

//----------PANOUT_DETECT-----------
#define PANOUT_DETECT_CURRENT		20	   // > 600W pan out current AD value
#define PANCHECK_TOR	0

#define PANOUT_PPGTA_1	(512 - 20 * 16)
#define PANOUT_PPGTA_2	(512 - 16 * 16)//15
#define PANOUT_PPGTA_3	(512 - 14 * 16)//13
//
//----------PAN_DETECT--------------
#define PAN_DETECT_PULSE_WIDTH      7      // PAN_DETECT_PULSE_WIDTH 7us
#define PAN_DETECT_PULSE_NUM        6      // no pan pulse number 6
#define C_PAN_DETECT_PPGTA (256 - PAN_DETECT_PULSE_WIDTH*16) // 7us
//

extern vu8 PanMoveInDet;
extern vu8 StartWorkCount;
extern vu8 PanDetPulseCnt;
extern vu8 NoPanDetectedCnt;

void Prepare_PanDetect(void);
void PanMoveOut_Detect(void); // run every 100mS
void PanMoveIn_Detect(void);

#endif